package com.kj.xuyuan.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kj.xuyuan.R;
import com.kj.xuyuan.model.UserTagBean;

import java.util.List;

import androidx.annotation.Nullable;

public class UserTagAdapter extends BaseQuickAdapter<UserTagBean.ListBean, BaseViewHolder> {
    public UserTagAdapter() {
        super(R.layout.item_tag);
    }

    @Override
    protected void convert(BaseViewHolder helper, UserTagBean.ListBean item) {
        TextView tvTag = helper.getView(R.id.tv_tag);
        tvTag.setText(item.getTitle());
        if(item.isSelected()){
            tvTag.setTextColor(mContext.getResources().getColor(R.color.pink));
            tvTag.setBackgroundResource(R.drawable.shape_pink_stroke_corners_15);
        }else{
            tvTag.setTextColor(mContext.getResources().getColor(R.color.color_b8b8b8));
            tvTag.setBackgroundResource(R.drawable.shape_gray_stroke_15);
        }
    }
}
